package com.xpgk.mvc.collection.bentryRegister;

import java.util.HashMap;
import java.util.Map;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseController;
import com.xpgk.mvc.base.BaseModel;
import com.xpgk.mvc.codeSet.Code;
import com.xpgk.mvc.productSet.Product;


/**
 * 顾客协议model
 */
@SuppressWarnings("unused")
@Table(tableName = CollectionCustomerAgreement.table_name)
public class CollectionCustomerAgreement  extends  BaseModel<CollectionCustomerAgreement>{
	
	private static final long serialVersionUID = 6761767368352810428L;

	private static final Log log = Log.getLog(CollectionCustomerAgreement.class);

	public static final CollectionCustomerAgreement dao = new CollectionCustomerAgreement().dao();
	
	
	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	/**
	 * 表名称
	 */
	public static final String table_name = "sb_customer_agreement";
	/**
	 * 字段描述：ids 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";
	
	/**
	 * 字段描述：机构ids   字段类型：character varying 长度：32
	 */
	public static final String column_organIds = "organIds";
	/**
	 * 字段描述：会员的协议编号   字段类型：character varying 长度：20
	 */
	public static final String column_bh = "bh";

	/**
	 * 字段描述：减肥前体重(公斤)  字段类型：flost  长度：4
	 */
	public static final String column_before_weight = "before_weight";

	/**
	 * 字段描述：减肥后体重(公斤)  字段类型：flost  长度：4
	 */
	public static final String column_after_weight = "after_weight";

	/**
	 * 字段描述：标准体重    字段类型：flost  长度：4
	 */
	public static final String column_std_weight = "std_weight";
	/**
	 * 字段描述：疗程ids   字段类型 ：character varying   长度：32
	 */
	public static final String column_codeIds = "codeIds";

	/**
	 * 字段描述：疗程数    字段类型：bigint 长度：11
	 */
	public static final String column_treatment = "treatment";

	/**
	 * 字段描述：消费金额  字段类型：double 长度：10
	 */
	public static final String column_cost = "cost";
	/**
	 * 字段描述：是否支付  字段类型：char 长度：1
	 */
	public static final String column_isPay = "isPay";
	/**
	 * 字段描述：总目标  字段类型：character varying 长度：2
	 */
	public static final String column_target = "target";
	/**
	 * 字段描述：进店日期
	 */
	public static final String column_jdrq = "jdrq";

	/**
	 * 字段描述：签订协议的时间   字段类型 ：datetime 
	 */
	public static final String column_time = "time";

	/**
	 * 字段描述：customerId 字段类型 ：character varying   长度：11
	 */
	public static final String column_customerID = "customerIds";
	/**
	 * 字段描述：部门编号 字段类型 ：character varying   长度：20
	 */
	public static final String column_departmentBH = "departmentBH";
	
	/**
	 * 字段描述：状态   字段类型 ：character varying   长度：1
	 */
	public static final String column_state = "state";
	

	
	/**
	 * sqlId :sb.customerAgreement.selBH
	 * 描述：查询编号
	 */
	public static final String sqlId_selBH= "sb.customerAgreement.selBH";
	/**
	 * sqlId :sb.customerAgreement.column
	 * 描述：查询协议，自定义字段
	 */
	public static final String sqlId_column= "sb.customerAgreement.column";
	
	
	/**
	 * sqlId :sb.customerAgreement.selByCusAndOrg
	 * 描述：根据顾客ids和机构ids查询协议
	 */
	public static final String sqlId_selByCusAndOrg= "sb.customerAgreement.selByCusAndOrg";
	
	
	
	/**
	 * 关联查询，获取Code
	 * 
	 * @return
	 */
	public Code getCode() {
		return Code.dao.findById(this.getStr(column_codeIds));
	}
	/**
	 * 关联查询，获取疗程产品
	 * 
	 * @return
	 */
	public Product getProduct() {
		return Product.dao.findById(this.getStr(column_codeIds));
	}
}
